package jvmtest;
/**
 * Created with IntelliJ IDEA.
 *
 * @Author: Tom
 * @Date: 2022/01/18/10:50
 * @Description:
 */

/**
 *@ClassName JavaVMStackSOF
 *@Description
 *@Author 王琛
 *@Date 2022/1/18 10:50
 @Version 1.0
 */
public class JavaVMStackSOF {
    private int stackLength = 1;

    public void stackLeak(){
        stackLength++;
        stackLeak();
    }

    public static void main(String[] args) throws Throwable{
        JavaVMStackSOF oom = new JavaVMStackSOF();
        try {
             oom.stackLeak();
        }catch (Throwable e) {
            System.out.println("stack length:" + oom.stackLength);
            throw e;
        }
    }
}
